<?php

	/**
	 * method: fields
	 * 
	 * 28/01/2011: fixed not associative array allowance
	 * 10/01/2010: class creation
	 *
	 * @author bsuter
	 * @package devmod
	 * 
	 * method type args:
	 * @param $args [array] containg the fields for this type of mod
	 */
	class Devmod_method_fields extends Devmod_methods_abstraction {

		public function set_config($args)
		{
			$fields_config = array();
			
			foreach($args[0] as $key => $value)
			{
				if(is_int($key))
				{
					$fields_config[$value] = $value;
				} else {
					$fields_config[$key] = $value;
				}
			}
			
			$this->update_config('fields', $fields_config);
			
			$original = array();
		
			foreach($fields_config as $key => $name)
			{
				$original[] = $key;
			}

			$this->update_config('original', $original);
		}
	}
